UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MUx6B6jmFKUqoOFtHZmmeoDPWTUZZG2TAi4HiJ/+26Y='
WHERE
key_id = '8b9fa988edb52c864f2ec201fb5283150cc2b8815819e75029c403ddb9130ecc'
AND (
token = 'MUx6B6jmFKUqoOFtHZmmeoDPWTUZZG2TAi4HiJ/+26Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)