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