UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H1ySC/S1v/4u/7GKqQ28uGnb8ge5vInSgTIjp6075jw='
WHERE
key_id = 'f7dffea41a19e81f2c656be4bd5072c1676076663d751a5519ee8a9328444c7a'
AND (
token = 'H1ySC/S1v/4u/7GKqQ28uGnb8ge5vInSgTIjp6075jw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)