UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XVfrDb0W5GxoonX9+ei4ngY9VebTa+JRmROSJQSoXck='
WHERE
key_id = '797095023905e5fffe7e466fd5850da3d01f243301bca240dbae3971daad71f7'
AND (
token = 'XVfrDb0W5GxoonX9+ei4ngY9VebTa+JRmROSJQSoXck='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)