UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oVRxHO+bBtr+UrXRH0bKT+8C04c6sdtgrfrLqXdt6uA=' 
WHERE 
  key_id = '701013567ddbe8b705bd507f8e01f3d58cc1c3d8779f14bc4d3377463f6efa3f' 
  AND (
    token = 'oVRxHO+bBtr+UrXRH0bKT+8C04c6sdtgrfrLqXdt6uA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015