UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0RmdnoPA6MYfgAxpRilhUF7N1V/2wMvIpLG6RKurA9g='
WHERE
key_id = 'f58f7be5d4c573a45680d424eca1ee21779d57b9e88ae4161c9f4b8babc6d9af'
AND (
token = '0RmdnoPA6MYfgAxpRilhUF7N1V/2wMvIpLG6RKurA9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)