UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qd9x72NcUQwS81kJrb6LR1JWtrWmynI6Lq7jEQ+DoZY='
WHERE
key_id = '25ba34dd6873c33ce571ff3846521d3e121c7e130cb09491672cc3fd4e938f97'
AND (
token = 'qd9x72NcUQwS81kJrb6LR1JWtrWmynI6Lq7jEQ+DoZY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)