UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K21CIS4LRExadgNFYjY4ZVtCK5EJZMwHfdTvQByGkbM='
WHERE
key_id = 'b3709e502e36730868cccab2fa1c8a0f08a06c980fa2a8a98fe4fbf53ac387a3'
AND (
token = 'K21CIS4LRExadgNFYjY4ZVtCK5EJZMwHfdTvQByGkbM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)