UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+9l1qAhVBTlJkb6M1AC4bWdNxSazX68KzbiS/nAD97M='
WHERE
key_id = 'f9c1a7a654e5ddfbba2502911c7f899b79332034d9611922fd60ceaa33dfc308'
AND (
token = '+9l1qAhVBTlJkb6M1AC4bWdNxSazX68KzbiS/nAD97M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)