UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FvA9wy16H3bQsjS48WUFPtGofUZDCDiWkk/LkebBvrk=' 
WHERE 
  key_id = '3efe6956a3be3d851707782892fd6349214b27f76e0035c4f68a1e9606cf3abe' 
  AND (
    token = 'FvA9wy16H3bQsjS48WUFPtGofUZDCDiWkk/LkebBvrk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030