UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0mYqugNJYxl7KrwhNw1guLUcPCGXC3OLCsvcVJbaaus='
WHERE
key_id = '126844a00701669980835fd3b8e1ecf377a50d4a19661255a36e636f76c25729'
AND (
token = '0mYqugNJYxl7KrwhNw1guLUcPCGXC3OLCsvcVJbaaus='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)