UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0O8CVYYRjCPZSi76WuH/a99SnZawIyvfG66WICAxDbg='
WHERE
key_id = '4722a5aab38b1dd7ac72b4457bda1bf1f3d9ce13d1e34c81649927832d16641a'
AND (
token = '0O8CVYYRjCPZSi76WuH/a99SnZawIyvfG66WICAxDbg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)