UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/K0AMCQqsNXcZpGNupJmrKRannb8J6YaPqNRFR0VPPs='
WHERE
key_id = '9654e793522f86284828011aa4b0d5da32593f99dd36a80b5009399848544f89'
AND (
token = '/K0AMCQqsNXcZpGNupJmrKRannb8J6YaPqNRFR0VPPs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)