UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WMaRFEI5aw+JKodztzO18wX3KKG5jYCSjdWCJgCkFrc=' 
WHERE 
  key_id = '027925953ee79593ac921150c4ba8c69aa44f779979b8c99fdd1e1b4f1f8c482' 
  AND (
    token = 'WMaRFEI5aw+JKodztzO18wX3KKG5jYCSjdWCJgCkFrc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043