UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qniszAOTSraHx4ezZbaxy9TOl9hbI9LV/dv9RdHLW18=' 
WHERE 
  key_id = 'cb91ab9b775e460771a8910d51cf2ff13fec0fb6a213605acbe1850749d22302' 
  AND (
    token = 'qniszAOTSraHx4ezZbaxy9TOl9hbI9LV/dv9RdHLW18=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032