UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VkuZ0HH3PNQG9bPUF12Qg17/Y/tAoTc4T8WlqHzF9vI='
WHERE
key_id = 'e8c1346a781100730c6d8febcd62ef7e9a7fa5cae6a1519f432be24e9a3146d5'
AND (
token = 'VkuZ0HH3PNQG9bPUF12Qg17/Y/tAoTc4T8WlqHzF9vI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)