UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gOOrADlykmfWCQHbz6xesGEPrsQOToVWNiuiArHoVFU='
WHERE
key_id = '765980226747ae1b00d8793e6473a8b8f457257acaae9ccaa64015c9f6eaa67f'
AND (
token = 'gOOrADlykmfWCQHbz6xesGEPrsQOToVWNiuiArHoVFU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)