UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DeZlGvuxIYh9WuAwx+dhcwz2lCuZ7HAGyHTmWjxPO0M='
WHERE
key_id = '5ad0e43dd9f2729832d4cc32f228ede5d4d4233ab516ae310c9a089a4fcf819b'
AND (
token = 'DeZlGvuxIYh9WuAwx+dhcwz2lCuZ7HAGyHTmWjxPO0M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)