UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gW55ov39hFIRVEXb+xd5QEc8k+Pcy4BMS1wpaqPYbBA='
WHERE
key_id = '1296216f8bb434d8d9656d2e4de3d1bfebca1ae93655fa7f6a83d741ee8ef5eb'
AND (
token = 'gW55ov39hFIRVEXb+xd5QEc8k+Pcy4BMS1wpaqPYbBA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)