UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Khur8B0K7j1rzyjHOkM4NB6gkVV1nIaf8r6c2GOMa54='
WHERE
key_id = '0b17a758148bae9fa4f12b465855f174e4c6d512f66cea3a664ee1c9c372f48a'
AND (
token = 'Khur8B0K7j1rzyjHOkM4NB6gkVV1nIaf8r6c2GOMa54='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)