UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9Y3SZe7OaLUQDZ1ysKbXaDTNp/+7Pnh2d6/aZTKRW2M=' 
WHERE 
  key_id = '2b06f4db315e9d39c357813f333541971b9bccb761622f280a243ed8cc33d637' 
  AND (
    token = '9Y3SZe7OaLUQDZ1ysKbXaDTNp/+7Pnh2d6/aZTKRW2M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062