UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oU3qR10D2wKrVVk14mThS0K02D3tgnaQ7e0rc0y7YFk='
WHERE
key_id = '4cc051f3d6d58d5dafba08ba76ae522e0d964c2accd5b76b8d2b15a10a472060'
AND (
token = 'oU3qR10D2wKrVVk14mThS0K02D3tgnaQ7e0rc0y7YFk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)