UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZEvinWmRBVCaZkc89lMFw4cvBOxQCeW7uE1zETohrlU=' 
WHERE 
  key_id = '2600d1d86a65fb99f2f985e7f84b32a553e1d2c3ec9cd373e8969e6e57327323' 
  AND (
    token = 'ZEvinWmRBVCaZkc89lMFw4cvBOxQCeW7uE1zETohrlU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036