UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2FpPFOF3KDHPwJZ5t2mu8OIdOuIW7Y5R2PwjNlxZg/I=' 
WHERE 
  key_id = 'df4f5b9e98034218ba3111f292666ffeb7de6400560ef436bd6520c316233797' 
  AND (
    token = '2FpPFOF3KDHPwJZ5t2mu8OIdOuIW7Y5R2PwjNlxZg/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030