UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yfGPd2U5W4PFpSMaXbmj0Ly0wUKPZZQ9c8W5k7iFPN8=' 
WHERE 
  key_id = 'e6319eb23ce8d7279aef59ce01a7c7ac734dfe5dad0decad346f4d91834ae538' 
  AND (
    token = 'yfGPd2U5W4PFpSMaXbmj0Ly0wUKPZZQ9c8W5k7iFPN8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036