UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3/AISEYnxkxqPU5r24l/hOEvuTf55itbR+jMwr//CgU=' 
WHERE 
  key_id = 'c43a2557c532d641c2d81d59e6a22dedabb3e73e1914126e01f032089aec92b8' 
  AND (
    token = '3/AISEYnxkxqPU5r24l/hOEvuTf55itbR+jMwr//CgU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035