UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4GKWKYxs1xVzpPWh3pnjDjfraan9nTwqbPadabsDlv8='
WHERE
key_id = '95d2a265603ca4b719fdbd2662f07925f6a6900c986f393bc8d060177cdac8f0'
AND (
token = '4GKWKYxs1xVzpPWh3pnjDjfraan9nTwqbPadabsDlv8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)