UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cjahMSqSoYOvy7f2IVScO/FvcU2uR3aXanO6PFsJljE=' 
WHERE 
  key_id = '0729f962acdf57ff10e72da7a8521376c770eabfcce638c3df14258d25c8e324' 
  AND (
    token = 'cjahMSqSoYOvy7f2IVScO/FvcU2uR3aXanO6PFsJljE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040