UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JxCyCCdWciDMpeVb/noHSHmvRX40JTtSs2WjfVhP6sE=' 
WHERE 
  key_id = 'c9b8d150af1cd145157138ea63eca7da5f9db9eca4e125beb36fad498826caac' 
  AND (
    token = 'JxCyCCdWciDMpeVb/noHSHmvRX40JTtSs2WjfVhP6sE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019