UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7fWHDOo+zWrjYQjcIHBrnbQZkgI/XRAlFGZ64jGU1Gc='
WHERE
key_id = 'e6acb28d5ffd43ce950bc4fb7afde774e796d03c0b19580c2a0065dbdbc13828'
AND (
token = '7fWHDOo+zWrjYQjcIHBrnbQZkgI/XRAlFGZ64jGU1Gc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)