UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DbBAG2gLcD9xX487cqBmbkt4FKF3BPkt6/3ENG3WTiU='
WHERE
key_id = '9226f1120c4fba0f23f04b60ce1482007b3cb232d98a49fc53e95387cdbe1903'
AND (
token = 'DbBAG2gLcD9xX487cqBmbkt4FKF3BPkt6/3ENG3WTiU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)