UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3KR/ZCHCPcC5biMVw3BNnj2VRC72WhImdTOs28iQoVI='
WHERE
key_id = 'f391fe6ff579c546806bf23360f7e277009c009f01a76723ffed4160eff3e3a8'
AND (
token = '3KR/ZCHCPcC5biMVw3BNnj2VRC72WhImdTOs28iQoVI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)