UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2aIYq9mBq/RU+jP8mTAaVKoDDBy8aGPnQBoNBHU/rW4=' 
WHERE 
  key_id = '98e139ed7d71cf9f6222552fab6c941b9e2396ecc7ca994d3d68d7286370671b' 
  AND (
    token = '2aIYq9mBq/RU+jP8mTAaVKoDDBy8aGPnQBoNBHU/rW4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028