UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '83dPI0cbyPTZGO7cOYu6WGljeRrXauOaVE8CtsMFD8Y=' 
WHERE 
  key_id = 'a06c8bf4d4a7bf0776c4bbc0a0e82e201cd9e1c36c502718a092ad9ef146e2db' 
  AND (
    token = '83dPI0cbyPTZGO7cOYu6WGljeRrXauOaVE8CtsMFD8Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036