UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EDmkivfufiBeIN08f/SG/q27ay2naPIpn0J6UbpynqI=' 
WHERE 
  key_id = '7ce41bcd38d570ec432301e574c97f04dd29e331a31fac56f54bd177f9ca0e91' 
  AND (
    token = 'EDmkivfufiBeIN08f/SG/q27ay2naPIpn0J6UbpynqI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025