UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's4xwI9zK4d82eMq2Pkrjug2mYSCYskRcYlSC5Ao/DVM=' 
WHERE 
  key_id = '018676e60861d3cc9c6673b0502aa7d807c368463c2398da7c93a6aa1b2c1576' 
  AND (
    token = 's4xwI9zK4d82eMq2Pkrjug2mYSCYskRcYlSC5Ao/DVM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025