UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Cyc4BjVCSQqEjg4DQ4z3ewkR/LZbELJRnPfpPv924s='
WHERE
key_id = '8b57c92f6df356757b752b3cc07cf30b6f1beadd2c248c6db4014db69910b3f0'
AND (
token = '7Cyc4BjVCSQqEjg4DQ4z3ewkR/LZbELJRnPfpPv924s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)