UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MwmJwLdGYqHq0jTxasQ4x/w3SJVwE4JKc2k8e/RkvM4='
WHERE
key_id = '96ba26a7f78c4b59c05aaf969a79cad0d5237baf7121d51485ada86cada11320'
AND (
token = 'MwmJwLdGYqHq0jTxasQ4x/w3SJVwE4JKc2k8e/RkvM4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)