UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OIuPlYHGUUeBbLocox6wbE9Qq72sDbsUZgCNjyIuZdo='
WHERE
key_id = '8813349209a3036a2900510c996fbda289521c03ff551bc1f7fe184c8ab1160d'
AND (
token = 'OIuPlYHGUUeBbLocox6wbE9Qq72sDbsUZgCNjyIuZdo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)