UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f068TR07J1nTRrk1m2ogI6RQIXIbzIc2ac6BgqWiSHk='
WHERE
key_id = 'e515b339835571136681f3fcf0bfb2db25ff510883f000799550a1744292ed13'
AND (
token = 'f068TR07J1nTRrk1m2ogI6RQIXIbzIc2ac6BgqWiSHk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)