UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k9+/+YbmPErefqJANZCweLI1JD7i13FC96PdmtX+LPg='
WHERE
key_id = '8a85b3a48b6bd7b63421688771ffd0d984477abbe1c5bcdfb1b8e07d54d61cb4'
AND (
token = 'k9+/+YbmPErefqJANZCweLI1JD7i13FC96PdmtX+LPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)