UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SqO/iJY/gblhq43fU9LVsFYhFG7rqddh0iSUOeyztaQ='
WHERE
key_id = '9a09bd433751438d0a25d7b75a26e106cfb297e2d59dedb55450b4c4a8fd7efe'
AND (
token = 'SqO/iJY/gblhq43fU9LVsFYhFG7rqddh0iSUOeyztaQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)