UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'evQ4LKXdF0029XezZ2XruCMxhqarih6oYexiUt7VoXY=' 
WHERE 
  key_id = '4831c6729e980eda2d8a7de3fe18a6b64d1d5b3fdda4976e9d1479c01ec4d7a2' 
  AND (
    token = 'evQ4LKXdF0029XezZ2XruCMxhqarih6oYexiUt7VoXY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033