UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pEUYy2OXQ9k0+JMXXw1LJQFpraS+WldUkpfEqv2i/nQ='
WHERE
key_id = 'd29334534f7cc2eeb1e3b89ce8a97543c6406b9bd24f8df54d7d909410814534'
AND (
token = 'pEUYy2OXQ9k0+JMXXw1LJQFpraS+WldUkpfEqv2i/nQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)