UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GblMPz7wA9gGHaxhPeyjWkNpNuvO66EnYVyweirao4g='
WHERE
key_id = '3cf6c1cb5da4188d7d33fe7df35d55f8251ca061be836e1a03869e2178109fb8'
AND (
token = 'GblMPz7wA9gGHaxhPeyjWkNpNuvO66EnYVyweirao4g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)