UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wUFDiC8FJsSe/iQfSsb576e6BmU/mmc6Xfh0WLAJZk4='
WHERE
key_id = 'c343f408534c5d7e85a23db84a6a49cafd47702c9609b56f651c1efe344a0f6a'
AND (
token = 'wUFDiC8FJsSe/iQfSsb576e6BmU/mmc6Xfh0WLAJZk4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)