UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/NyG2WoGb4dCCU5UsAu6aN3cIinowdjlyesWJGrn+ow='
WHERE
key_id = 'fa1aa3c694033609a6c17b146b89184530befaad6c75b9aec9aecb296b1974cf'
AND (
token = '/NyG2WoGb4dCCU5UsAu6aN3cIinowdjlyesWJGrn+ow='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)