UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XhBGOkd61vsOHzuNxkpySPL9ZJnbNQzEnustZT/kBXs='
WHERE
key_id = '7ac3fc8c451273e5697a96c670e07d0ec3108a15c204ec1f59b095999b494799'
AND (
token = 'XhBGOkd61vsOHzuNxkpySPL9ZJnbNQzEnustZT/kBXs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)