UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'crVUSdYOQr/rGnc8nvyuCArXT1/RdyzPuZyUdC3g8CI='
WHERE
key_id = 'e2acc3a52c6dbe3c8024deec49c4e915dac8c7ff0c51bd35bcb9f8a0ccd33018'
AND (
token = 'crVUSdYOQr/rGnc8nvyuCArXT1/RdyzPuZyUdC3g8CI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)