UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h2J8VFZxVrpI37+kCd9mGHb5ZWrJe+Tn3K2gLOlmvsw='
WHERE
key_id = '3b1134d10d3bafd965e1eecd83113ec5da09a4b6ff8897c36272f692be2edefe'
AND (
token = 'h2J8VFZxVrpI37+kCd9mGHb5ZWrJe+Tn3K2gLOlmvsw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)