UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o/Fi3O2/RMOYPxmEoXmw48VKYR9LPe2NVg1beazeF7o=' 
WHERE 
  key_id = 'b6649543d91e5dac88a1cbf47b9c346868dde70aebef9decc4129a8618af70f1' 
  AND (
    token = 'o/Fi3O2/RMOYPxmEoXmw48VKYR9LPe2NVg1beazeF7o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021